package chapter_19_mediator.classic;

/**
 * @author yaochenglong
 * @date 2017/10/23
 * 抽象中介者；
 *
 *
 */
public abstract class AbstractMediator {

    //定义同事类
    protected ConcreteColleague1 concreteColleague1;
    protected ConcreteColleague2 concreteColleague2;

    //中介者模式的业务逻辑；该逻辑实现了复杂功能，可能要多个同事类协作才能完成
    public abstract void doSomething1();
    public abstract void doSomething2();

    //注入同事类
    public void setConcreteColleague1(ConcreteColleague1 concreteColleague1) {
        this.concreteColleague1 = concreteColleague1;
    }

    public void setConcreteColleague2(ConcreteColleague2 concreteColleague2) {
        this.concreteColleague2 = concreteColleague2;
    }
}
